package com.M10.BE.database;

/**
 * Created by Administrator on 2018/8/8.
 */

import android.net.Uri;

public class Constants {
    public static final String DBAdapter_TAG = "ASSETDatabaseHelper=>";
    public static final String ChanceProvider_TAG = "InventoryProvider=>";
    /**
     * 相关AppID定义
     */
    public static final int CHANCE_INTERNAL_APPID = 0x00000001;
    public static final int DIARY_APPID = 0x00000002;
    public static final int ALBUM_APPID = 0x00000003;
    public static final int SINGLE_CHAT_APPID = 0x00000004;

    public static final int DIRECTSHARE_APPID = 0x0000000a;

    /**
     * chance第三方应用包名定义
     */
    public static final String CHANCEAPP_DIRECTSHARE = "com.chance.share";


    /*
     * ContentProvider相关常量定义
     */
    public static final String AUTHORITY = "com.asset.provider";                   // 单个authority
    public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.com.asset";
    public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.com.asset";

    // 匹配类型定义
    // 表中ID与整个表的分隔数据点
    public static final int ID_DIVIDE = 1000;

    // 1.表C_UserInfo
    public static final int C_Inventory = 1;
    public static final int C_Inventory_ID = C_Inventory + ID_DIVIDE;

    // 2.表C_Friend
    public static final int C_Asset = 2;
    public static final int C_Asset_ID = C_Asset + ID_DIVIDE;


    // 表C_UserInfo URI
    public static final Uri CONTENT_C_INVENTORY_URI = Uri
            .parse("content://" + AUTHORITY + "/" + Constants.TABLE_INVENTORY);
    // 表C_Friend URI
    public static final Uri CONTENT_C_ASSET_URI = Uri
            .parse("content://" + AUTHORITY + "/" + Constants.TABLE_ASSET);


    /*
     * 数据库相关常量定义
     */
    public final static String DB_NAME = "inventory_data";
    public final static int DB_VERSION = 4;
    public final static int DB_DEFAULT_VERSION = 0;
    public final static String SQLITE_VERSION = "1.1.0";                 // 此版本开始支持外键约束
    public final static String OPEN_FOREIGN_KEY = "PRAGMA foreign_keys=ON;";

    public final static long TABLENAME_ERROR = -3; // 表明不存在
    public final static long RECORD_EXIT = -2; // 记录已经存在

    public final static int SQLITE_TABLE_HASINIT = 1; //数据库表已经初始化


    public static final String ID = "id";
    public static final String TABLE_INVENTORY = "t_inventory";
    public static final String INVENTORY_ID = "inventoryid";
    public static final String INVENTORY_ORDERNO = "orderno";
    public static final String INVENTORY_ORGNAME = "orgname";
    public static final String INVENTORY_JUDGEUSER = "judgeuser";
    public static final String INVENTORY_SEAMOUNT = "seamount";
    public static final String INVENTORY_SETIME = "setime";
    public static final String INVENTORY_QUERYCOUNT = "querycount";
    //table asset
    public static final String TABLE_ASSET = "t_asset";
    public static final String ASSET_INVENTORYID = "inventoryid";
    public static final String ASSET_CARDID = "cardid";
    public static final String ASSET_NAME = "name";
    public static final String ASSET_ZCNO = "zcNo";
    public static final String ASSET_CNUM = "cnum";
    public static final String ASSET_USEORG = "useorg";
    public static final String ASSET_LABELID = "labelid";
    public static final String ASSET_LABELTYPE = "labeltype";
    //盘点单表
    public static final String CREATE_TABLE_INVETORY = "Create TABLE IF NOT EXISTS t_inventory("
            + ID + " INTEGER PRIMARY KEY ,"
            + INVENTORY_ID + " Varchar(100) , "
            + INVENTORY_ORDERNO + " Varchar(100) , "
            + INVENTORY_ORGNAME + " Varchar(100) , "
            + INVENTORY_JUDGEUSER + " Varchar(100) , "
            + INVENTORY_SEAMOUNT + " Varchar(100) ,"
            + INVENTORY_SETIME + " Varchar(100) , "
            + INVENTORY_QUERYCOUNT + " Varchar(100))";


    //资产表
    public static final String CREATE_TABLE_ASSET = "Create TABLE IF NOT EXISTS t_asset("
            + ID + " INTEGER PRIMARY KEY ,"
            + ASSET_INVENTORYID + " Varchar(50) , "
            + ASSET_NAME + " Varchar(100) , "
            + ASSET_ZCNO + " Varchar(50) , "
            + ASSET_CNUM + " Varchar(50) , "
            + ASSET_USEORG + " Varchar(50) , "
            + ASSET_LABELID + " Varchar(50) , "
            + ASSET_LABELTYPE + " Varchar(50) , "
            + ASSET_CARDID + " Varchar(50))";
//    public static final String Create_C_Lbs_History = "CREATE TABLE IF NOT EXISTS C_Lbs_History("
//            + Lbs_CID + " INTEGER PRIMARY KEY ,"
//            + Lbs_VisitCount + " INTEGER," + Lbs_SelfCID
//            + " INTEGER," + Lbs_LoveCount + " INTEGER,"
//            + Lbs_AttCount + " INTEGER," + Lbs_Distance
//            + " INTEGER," + Lbs_Sex + " INTEGER,"
//            + Lbs_NickName + " text," + Lbs_Flag
//            + " INTEGER," + Lbs_Mod + " text,"
//            + Lbs_Reserved1 + " NUMERIC," + Lbs_Reserved2
//            + " NUMERIC," + Lbs_Reserved3 + " NUMERIC,"
//            + Lbs_Reserved4 + " NUMERIC," + Lbs_Reserved5
//            + " NUMERIC," + Lbs_Reserved6 + " NUMERIC,"
//            + Lbs_Reserved7 + " NUMERIC," + Lbs_Reserved8
//            + " NUMERIC," + Lbs_Reserved9 + " NUMERIC,"
//            + Lbs_Reserved10 + " NUMERIC,"
//            + Lbs_Reserved11 + " NUMERIC,"
//            + Lbs_Reserved12 + " NUMERIC" + ")";

}

